package com.vhall.component.service.redpacket.common;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 赠送类型
 *
 * @author xuyongzheng
 * @since 2021/3/7 16:39
 **/
@Getter
@AllArgsConstructor
public enum GiveType {

    /**
     * 0-直播流量 0
     */

    RED_PACKET(1, "红包"),
    /**
     * 1- 回放流量
     */
    GIFT(2, "表情");

    private final int code;
    private final String mark;

    public static GiveType valueOf(Integer code) {
        return Arrays.stream(values()).filter(type -> type.getCode() == code).findFirst().orElse(null);
    }

}
